﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Diagnostics;
//using System.Configuration;
using System.Data.SqlClient;


namespace QuanLiGiaiBongDa
{
    public partial class frmGiaoDien : Form
    {
        public frmGiaoDien()
        {
            InitializeComponent();
        }
        private void StatusBarToolStripMenuItem_Click(object sender, EventArgs e)
        {
            statusStrip.Visible = statusBarToolStripMenuItem.Checked;
        }
        private void frmGiaoDien_Load(object sender, EventArgs e)
        {
            frmDangNhap f = new frmDangNhap();
            f.ShowDialog();
            ts_Nguoidung.Text = " Đang Sử Dụng Chương Trình";
            ts_thoigian.Text = DateTime.Now.ToString(" dd/MM/yyyy hh:mm:ss");
        }

        private void tsQlTrongTai_Click(object sender, EventArgs e)
        {
            frmQlTrongTai fQltt = new frmQlTrongTai();
            fQltt.Show();
            fQltt.MdiParent = this;
        }

        private void tsQlDoiBong_Click(object sender, EventArgs e)
        {
            frmQL_Doibong fQldb = new frmQL_Doibong();
            fQldb.Show();
            fQldb.MdiParent = this;
        }

        private void tsQlKetQua_Click(object sender, EventArgs e)
        {
            frmQlKetQua fQlhq = new frmQlKetQua();
            fQlhq.Show();
            fQlhq.MdiParent = this;
            
        }

        private void tsQlThiDau_Click(object sender, EventArgs e)
        {
            frmQlThiDau fQltd = new frmQlThiDau();
            fQltd.Show();
            fQltd.MdiParent = this;
        }

        private void tscascade_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.Cascade);
        }

        private void tstileHorizontal_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void tstileVertical_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

        private void tscloseAll_Click(object sender, EventArgs e)
        {
            foreach (Form childForm in MdiChildren)
            {
                childForm.Close();
            }
        }
        private void tsabout_Click(object sender, EventArgs e)
        {
            Process.Start("About.pdf");
        }

        private void tsExit_Click(object sender, EventArgs e)
        {
                Application.Exit();
        }

        private void tsC_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.Cascade);
        }

        private void tsH_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileVertical);
        }

        private void tsV_Click(object sender, EventArgs e)
        {
            LayoutMdi(MdiLayout.TileHorizontal);
        }

        private void closeAllToolStripMenuItem_Click(object sender, EventArgs e)
        {
            foreach (Form childForm in MdiChildren)
            {
                childForm.Close();
            }
        }

        private void tsDoiMatKhau_Click(object sender, EventArgs e)
        {
            
        }

        private void tsLogoff_Click(object sender, EventArgs e)
        {
            Application.Restart();
            frmDangNhap fDangnhap = new frmDangNhap();
            fDangnhap.ShowDialog();
        }

        private void msTracuu_Click(object sender, EventArgs e)
        {
            frmTraCuu ftracuu = new frmTraCuu();
            ftracuu.Show();
            ftracuu.MdiParent = this;
        }

        private void tsthemnguoidung_Click(object sender, EventArgs e)
        {
            frmThemNguoidung fthemuser = new frmThemNguoidung();
            fthemuser.Show();
            fthemuser.MdiParent = this;
        }

        private void frmGiaoDien_FormClosing(object sender, FormClosingEventArgs e)
        {
            DialogResult d = MessageBox.Show("Bạn muốn thoát khỏi chương trình?", "Thông Báo", MessageBoxButtons.YesNo, MessageBoxIcon.Question, MessageBoxDefaultButton.Button1);
            if (DialogResult.No == d)
                e.Cancel = true;
        }

        private void optionsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            frmXepHang f = new frmXepHang();
            f.Show();
            f.MdiParent = this;
            
        }
        public void EnableMenu()
        {
            msQuanli.Enabled = true;
        }
    
    }
}
